﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Mvc;

namespace FZKJ.ZHXJ.Controllers
{
    [FZKJ.ZHXJ.FilterConfig.LoginCheckFilter(IsCheck = false)]
    public class TestController : Controller
    {
        //
        // GET: /Test/

        
        [FZKJ.ZHXJ.FilterConfig.LoginCheckFilter(IsCheck = false)] 
        public ActionResult Index()
        {
            // Regex reg = new Regex(@"<li>([^<]+)</li>", RegexOptions.IgnoreCase); li标签不带属性
            //string str = "<html><body><li>测试1</li><li>测试2</li><li>测试3</li><li>测试4</li><li>测试5</li><li>测试6</li></body></html>";

            Regex reg = new Regex(@"%<li.*?>(.*?)</li>%si", RegexOptions.IgnoreCase);

            string str = "<html><body><li style=\"aa\">测试1</li><li>测试2</li><li>测试3</li><li>测试4</li><li>测试5</li><li>测试6</li></body></html>";
            Match m = reg.Match(str);
            while (m.Success)
            {
                Console.Write(m.Result("$1"));// 输出匹配到的li的内容
                m = m.NextMatch();
            }
            return View();
        }

    }
}
